<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <link rel="stylesheet" href="./index.css">
</head>
<body>
  
  <div id="app">
    <input v-model="value"/><br>
    
    {{ value }}

    <button @click="addClick">按钮++</button>
    <button v-on:click="parameter(1, '这是字符串')">参数++</button>
    <button v-on:click="parameter(value)">传递data值</button>
    <div>++值 {{ current }}</div>
    text: <input v-model="text"/><br>
    <div v-text="text"></div>
    <div v-html="html"></div>
    <div v-if="remove">需要被移除的元素</div>
    <div v-show="show">需要被隐藏的元素</div>
    顶部
    <div v-for="itme in arr">
      <div>{{item}}</div>
    </div>
    底部
  </div>

  <script src="./util.js"></script>
  <script src="./Compiler.js"></script>
  <script src="./Observe.js"></script>
  <script src="./incident.js"></script>
  <script src="./Driver.js"></script>
  <script src="./index.js"></script>
  <script type="text/javascript">
    const app = new Vue({
      el: '#app',
      data: {
        value: '这是一段value文本',
        current: 2,
        html: '<h1>这是一个h1标签</h1>',
        text: '这是一个text文本',
        remove: false,
        show: true,
        arr: [1,2,3,4,5,6]
      },
      watch: {
        current() {
          console.log('watch 监听到了current 变化' + current)
        }
      },
      mounted() {
        console.log('DOM 创建完毕')
        this.current++
      },
      methods: {
        addClick() {
          this.current++
          console.log(this)
          console.log(this.current)
        },
        parameter(text) {
          console.log(this.text)
          console.log(text)
        }
      }
    })

    
  </script>
</body>
</html>

